In typical database systems, users write, update, and retrieve information by submitting commands to a database application. To be correctly processed, the commands must comply with the database language that is supported by the database application. One popular database language is known as Structured Query Language (SQL), which may be used to code a Multiple Distinct Aggregate (“MDA”) type query such as:
SELECT a1,                COUNT(DISTINCT(c1)), SUM(DISTINCT(c2)),        
AVG(DISTINCT(c3))
FROM A
WHERE A.b>100
GROUP BY a1
As explained further below, MDA type queries may pose problems, particularly with respect to duplicate elimination during execution.